<template>
	<view class="container">
		<view class="none" v-if="result.length==0">没有记录</view>
		<view class="order_unit"  v-for="(item,index) in result" :key="index" v-else>
			<view class="content">
				<view class="nickname">
					<image class="avatar" :src="item.m_img" v-if="item.m_img.length>10"></image>
					<image class="avatar" :src="static_url+'/logo.png'" v-else></image>
					{{item.m_nickname}}
					<!-- <view class="grade" v-if="item.m_grade==1"><image :src="static_url+'/x.png'"></image>健康管家</view>
					<view class="grade" v-if="item.m_grade==2"><image :src="static_url+'/y.png'"></image>健康顾问</view> -->
				</view>
				<view class="nickname">
					上一级：
					<image class="avatar" :src="item.u_img" v-if="item.u_img.length>10"></image>
					<image class="avatar" :src="static_url+'/logo.png'" v-else></image>
					{{item.u_nickname}}
					<!-- <view class="grade" v-if="item.u_grade==1"><image :src="static_url+'/x.png'"></image>健康管家</view>
					<view class="grade" v-if="item.u_grade==2"><image :src="static_url+'/y.png'"></image>健康顾问</view> -->
				</view>
				<view class="order_num">{{item.order_num}}</view>
				<view class="unit_value">支付时间：{{item.datetime}}</view>
			</view>
			<view class="unit">
				<view class="price">×1</view>
			</view>
		</view>
	</view>
</template>
<style>
	page{background: #F4F4F4;}
	.container{width:100%;}
	.content{width: 95%;}
	.none{width:100%;height: 80upx;line-height: 80upx;text-align: center;font-size: 28upx;}
	.order_unit{width:92%;margin:10upx 2%;padding:10upx 2%;background:#FFFFFF;display: flex;justify-content: space-between;}
	.avatar{width:50upx;height: 50upx;border-radius: 25upx;margin:0 10upx 0 0;}
	.order_num,.nickname{width:100%;font-size: 26upx;line-height: 70upx;}
	.order_num{font-size: 28upx;color: #999999;}
	.unit{width:5%;display: flex;justify-content: center;align-items: center;}
	.unit_key{font-size: 26upx;font-weight: bold;padding-right:10upx;text-align: center;}
	.unit_value{font-size: 28upx;padding-right:10upx;color: #999999;}
	.unit_value text{font-size:24upx;padding-left:20upx;color: #CCCCCC;}
	.operation{width:20%; text-align: center;}
	.price{font-size: 28upx; text-align: center;color: #ff1844;font-weight: bold;}
	.none_price{font-size: 28upx; text-align: center;color: #FFFFFF;font-weight: bold;}
	.none{width:100%;text-align: center;line-height: 80upx;font-size: 28upx;background: #FFFFFF;}
	.nickname{display: flex;justify-content: flex-start;align-items: center;line-height: 70upx;}
	.grade{padding:8upx 20upx;margin-left:10upx;display:flex;justify-content: flex-start;align-items: center;text-align: center;height: 30upx;line-height:30upx;;border-radius: 20upx;background: #e8c99c;font-size:24upx;}
	.grade image{width:25upx;height:25upx;}
	.n{color: #333333;}
</style>
<script>
	export default {
		data() {
			return {
				current: 1,
				pic_h:'',
				result:[],
				start:0,
				submit_status:1,
				refresh_status:0,
				switch1:0,
				price:0,
				url: getApp().globalData.url,
				static_url:getApp().globalData.static
			}
		},
		onLoad(e) {
			var res = uni.getSystemInfoSync();
			var w = res.windowWidth;
			this.pic_h = w*0.92*0.2+"px";
			this.initialize();
		},
		onReachBottom(){
			this.initialize();
		},
		methods: {
			initialize:function()
			{
				var that = this;
				var member_id = uni.getStorageSync("member_id");
				// var member_id = 170600;
				uni.request({
					url: this.url+'/wechat_free_gift_source', 
					data: {member_id:member_id,start:this.start},
					header: {'Content-Type': 'application/json'},
					success: (res) => {
						console.log(res);
						if(res.data.status==1)
						{
							if(that.start==0)
							{
								that.result = res.data.result;
							}
							else
							{
								for(var i=0;i<res.data.result.length;i++)
								{
									that.result.push(res.data.result[i]);
								}
							}
							that.start += 10;
						}
					}
				});
			}
		}
	}
</script>


